#pragma once


#include "../gui/gui_export.hpp"

#include "../gui/inc/app_manger.h"

#include "../apps/apps.h"

#include "../ui_res/images/images.h"

#include "../ui_res/fonts/fonts.h"

#include <vector>

void desktop_init(void);


class AppIcon :public Container
{
private:

  App* app = NULL;
  Label* label = NULL;
  Image* image = NULL;
  Container* container = NULL;
public:
  AppIcon(UI_Object* parent);
  AppIcon(UI_Object* parent, App* app);
  ~AppIcon();
  void set_app(App* app);
  void set_text(const char* text);
};

class AppsPage : public Page
{
private:
  Container* viewpoint;
  lv_coord_t origan_y = 0;
  void set_scroll_mode();
  std::vector<AppIcon*> appicons_array;

public:
  AppsPage();
  ~AppsPage();
  void load_apps_list();
  void render_apps_list();
  // void load_app(char* app_name);
};


class ControlPage : public Page
{
private:
  Container* viewpoint;
  Container* control_bar;

  ButtonSwitch* wifi_switch;

  ButtonSwitch* bluetooth_switch;

  ButtonSwitch* bell_switch;

  ButtonSwitch* setting_switch;

  ButtonSwitch* shutdowm_switch;

  ButtonSwitch* light_switch;

  Container* light_bar;

  Image* moon_icon;

  Slider* light_slider;

  Image* bright_icon;


public:
  ControlPage();
  ~ControlPage();
};


class MainPage : public Page
{
private:
  /* data */
  Container* viewpoint;
  Container* time_component = NULL;
  Container* battary_component = NULL;
  Container* picture_component = NULL;
  Container* weather_component = NULL;
  Container* notify_component = NULL;
  Container* ai_component = NULL;
  Button* ai_btn = NULL;
public:
  MainPage();
  ~MainPage();
};


class BeginPage :public Page {

private:


public:
  void begin_page_load(void);
  BeginPage();
  ~BeginPage();

};



extern lv_obj_t* ui_root_page;
extern lv_obj_t* ui_initial_actions;




extern BeginPage* begin_page;
extern MainPage* main_page;
extern ControlPage* control_page;
extern AppsPage* apps_page;
